<?php
$db = $x7->db ();

if (empty ( $_SESSION ['user_id'] )) {
	$x7->fatal_error ( $x7->lang ( 'login_required' ) );
}
if ($urlParam=="-1" )
{ 
	$sql = "SELECT * FROM {$x7->dbprefix}rooms";
	$st = $db->prepare ( $sql );
	$st->execute ();

}else {

	$sqlParams = array (
			':usage_type_id' => $urlParam
				
	);
 	
	$sql = "SELECT * FROM {$x7->dbprefix}rooms where usage_type_id=:usage_type_id ";
	$st = $db->prepare ( $sql );
	$st->execute ($sqlParams);
}

$rooms = $st->fetchAll ();

$x7->display ( 'pages/roomlist', array (
		'rooms' => $rooms 
) );